#include "process.h"
#include <unistd.h>

void DownLoad(double size, double speed) {
    int current_total = 0;
    while (current_total <= size) {
        Process2(size, current_total);
        if (current_total >= size) break;
        if (size - current_total < speed)
            current_total = size;
        else
            current_total += speed;
        usleep(50000);
    }
}

int main() {

//    Process();
    DownLoad(1024, 10);
    DownLoad(512, 10);
    DownLoad(256, 10);
    DownLoad(1024, 0);
    return 0;


}
